<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增企业')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-company-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">统一社会信用代码：</label>
                <div class="col-sm-8">
                    <input name="creditCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">企业名称：</label>
                <div class="col-sm-8">
                    <input name="compName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">联系人姓名：</label>
                <div class="col-sm-8">
                    <input name="contractName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input name="contractPhone" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">所在地区：</label>
                <div class="col-sm-8 form-inline">
                	<div id="distpicker2">
				        <select class="form-control" name="province"></select>
				       	<select class="form-control" name="city"></select>
				        <select class="form-control" name="district"></select>
			      	</div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">详细地址：</label>
                <div class="col-sm-8">
                    <input name="address" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">入驻时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="settlingTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <!-- 
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否明星企业：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('is_or_not')}">
                        <input type="radio" th:id="${'isStar_' + dict.dictCode}" name="isStar" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'isStar_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
             -->
            <div class="form-group">    
                <label class="col-sm-3 control-label  is-required">企业类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('company_type')}">
                        <input type="radio" th:id="${'companyType_' + dict.dictCode}" name="companyType" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'companyType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">企业标签：</label>
                <div class="col-sm-8">
                    <div class="check-box" th:each="dict : ${@dict.getType('company_tabs')}">
                        <input type="checkbox" th:id="${'companyTabs_' + dict.dictCode}" name="companyTabs" th:value="${dict.dictValue}" th:checked="false">
                        <label th:for="${'companyTabs_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                       <textarea type="text" name="remark" class="form-control" placeholder="请输入备注"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: distpicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/company"
        $("#form-company-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-company-add').serialize());
            }
        }

        $("input[name='settlingTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        
        $("#distpicker2").distpicker({
	       	  province: '---- 所在省 ----',
	       	  city: '---- 所在市 ----',
	       	  district: '---- 所在区 ----'
       	});
    </script>
</body>
</html>